import React from "react";
import {Collapse} from "antd";
import {MoreText} from "@/component/Mine/AdminConsole/OtherControl/style";
import {AccentBackgroundColor} from "@/style/Color";

const {Panel} = Collapse;

const OtherMenu = (props) => {
    function handleClickLi(index) {
        switch (index) {
            case 1:
                window._ROUTER_.push("/mine/admin/other-control/page")
                break;
            case 2:
                window._ROUTER_.push("/mine/admin/other-control/game-type")
                break;
            case 3:
                window._ROUTER_.push("/mine/admin/other-control/game-company")
                break;
            case 4:
                window._ROUTER_.push("/mine/admin/other-control/game-platform")
                break;
            default:
                break;
        }
    }

    return <>
        <Collapse defaultActiveKey={['1', '2']}>
            <Panel
                style={{backgroundColor: AccentBackgroundColor}}
                header={
                    <>
                        <span>类型管理</span>
                        <MoreText>(2项)</MoreText>
                    </>
                }
                key="1">
                <ul>
                    <li onClick={() => handleClickLi(1)}>文章类型管理</li>
                    <li onClick={() => handleClickLi(2)}>游戏类型管理</li>
                </ul>
            </Panel>
            <Panel
                style={{backgroundColor: AccentBackgroundColor}}
                header={
                    <>
                        <span>基础信息管理</span>
                        <MoreText>(1项)</MoreText>
                    </>
                }
                key="2">
                <ul>
                    <li onClick={() => handleClickLi(4)}>游戏平台信息管理</li>
                    <li onClick={() => handleClickLi(3)}>游戏厂商、工作室信息管理</li>
                    <li onClick={() => handleClickLi(5)}>系统字典值管理</li>
                </ul>
            </Panel>
        </Collapse>
    </>
}

export default OtherMenu;
